# import hashlib
#
#
# def generate_photo_id(photo_path):
#     with open(photo_path, "rb")as f:
#         data = f.read()
#     photo_hash = hashlib.md5(data).hexdigest()
#     return photo_hash
#
#
# photo_path = "/Users/bytedance/Desktop/图片/梅花.png"
# photo_id = generate_photo_id(photo_path)
# print("照片的ID为：", photo_id)


# import hashlib
# import base64
#
#
# def generate_photo_id(photo_path):
#     with open(photo_path, "rb")as f:
#         data = f.read()
#         hash_object = hashlib.sha256(data)
#         photo_hash = hash_object.digest()
#         photo_id = base64.urlsafe_b64encode(photo_hash)[:19].decode("utf-8")
#         return photo_id
#
#
# photo_path = '/Users/bytedance/Desktop/图片/梅花.png'
# photo_id = generate_photo_id(photo_path)
# print(photo_id)

#
# import os
#
#
# def get_file_size(file_path):
#     size = os.path.getsize(file_path)
#     size_str = ""
#     if size < 1024:
#         size_str = f"{size} B"
#     elif size < 1024 * 1024:
#         size_str = f"{size / 1024:.2f}KB"
#     else:
#         size_str = f"{size / (1024 * 1024):.2f}MB"
#         return size_str
#
#
# image_path = "/Users/bytedance/Desktop/photo/dameng1.jpeg"
# file_size = get_file_size(image_path)
# print(f"文件大小：{file_size}")



# domain="test1028"
# zone=".top"
# domain_names=[]
# for i  in range(1,101):
#     domain_name=domain+str2(i)+zone
#     domain_names.append(domain_name)
#
# for name in domain_names:
#     print(name)



# import random
# import string
#
# def generate_random_domain(length=8, suffix=".top"):
#     letters = string.ascii_lowercase
#     random_string = ''.join(random.choice(letters) for _ in range(length))
#     domain = random_string + suffix
#     return domain
#
# # 生成十个随机域名
# for _ in range(100):
#     random_domain = generate_random_domain()
#     print(random_domain)

# domain = "test08311"
# zone = ".top"
#
# # 生成一百个带有大括号格式的域名
# for i in range(1, 101):
#     domain_name = f"{{{domain}{i}{zone}}}"
#     print(domain_name)


